package com.eco
{
	import com.eco.*;
	import com.framework.*;
	
	import flash.display.MovieClip;
	import flash.events.*;
	import flash.utils.*;
	
	//加速道具，实际上是提升卫士敏感度的道具
	public class BonusSpeedUp extends Bonus
	{
		private var iNormalSensitivity:int;
		
		public function BonusSpeedUp()
		{
			super( 8, Bonus.BONUS_SPEEDUP);
			
			iFunctionTime = 5000;//持续5秒
		}
		
		override public function StartFunction():void
		{
			if( ftFighter == null )
				return;
			
			CreateSoundEvent( CustomEventSound.PLAY_SOUND, SoundInfo.EFF_BONUS_SPEEDUP_ACTIVE);
			
			//自己的变量用于保存当前情况下的卫士的状态，用于以后的还原
			iNormalSensitivity = ftFighter.iNormalSensitivity;
			
			ftFighter.iNormalSensitivity /= 2;
			super.StartFunction();
		}
		
		override public function StopFunction():void
		{
			ftFighter.iNormalSensitivity = iNormalSensitivity;
			
			super.StopFunction();
		}
	}
}